<template>
	<div>
		<div class="smp-search smp_panel">
			<div class="smp_panel_header">
				<div class="smp_panel_pre"></div>
				<div class="smp_panel_title">系统详情</div>
			</div>
			
			<div class="smp_panel_body_NopaddingTop">
				<div class="smp-search smp_panel_1">
					<div class="smp_panel_header">
						<div class="smp_panel_pre"></div>
						<div class="smp_panel_title">系统信息</div>
					</div>
					
					<div class=" smp_panel_body">
						<el-descriptions size="mini" :column="4" border>
							<el-descriptions-item label="系统名称"> {{row.systemName}} </el-descriptions-item>
							<el-descriptions-item label="系统编号"> {{row.systemNo}} </el-descriptions-item>
							<el-descriptions-item label="所属机构"> {{row.systemOrg|getOrgNameByOrgCode}} </el-descriptions-item>
							<el-descriptions-item v-if="row.systemOrg=='9999'" label="第三方名称"> {{row.trdName}} </el-descriptions-item>
							<el-descriptions-item label="系统简称"> {{row.systemShort}} </el-descriptions-item>
							<el-descriptions-item label="负责人"> {{row.systemResponsibleMan|getUserChinesName}} </el-descriptions-item>
							<el-descriptions-item label="创建时间"> {{row.createTime}} </el-descriptions-item>
							<el-descriptions-item label="关联需求"> {{row.associatedRequirement}} </el-descriptions-item>
							<el-descriptions-item label="消费接口数"> {{sysSum}} </el-descriptions-item>
							<el-descriptions-item label="服务接口数"> {{busSum}} </el-descriptions-item>
							<el-descriptions-item label="消费系统数"> {{systemNums.pubSystemNum}} </el-descriptions-item>
							<el-descriptions-item label="服务系统数"> {{systemNums.regSystemNum}} </el-descriptions-item>
							<el-descriptions-item label="测试地址"> {{row.testAddr}} </el-descriptions-item>
							<el-descriptions-item label="系统类型"> {{row.systemType|dictName("SMP0014")}} </el-descriptions-item>
							<el-descriptions-item label="系统状态"> {{row.systemStatus|dictName("SMP0002")}} </el-descriptions-item>
							<el-descriptions-item label="默认报文格式"> {{row.msgAgreement}} </el-descriptions-item>
							<el-descriptions-item label="默认报文编码"> {{row.msgCode|dictName("SMP0004")}} </el-descriptions-item>
							<el-descriptions-item label="备注"> {{row.remark}} </el-descriptions-item>
						</el-descriptions>
					</div>
					
					
				</div>
				
				<environmentInfo class="smp-result" ref="environment" :row="row" />
				
				<interactedSystemList class="smp-result" ref="interactedSystemList" :row="row" />
				
				<sysInterfaceList class="smp-result" ref="sysInterfaceList" :row="row" @sysInterTotal="sysInterTotal" />
				
				<busInterfaceList class="smp-result" ref="busInterfaceList" :row="row" @busInterTotal="busInterTotal" />
			
			</div>
		</div>
	</div>
</template>

<script>
	"use strict";
	import {
		getSysInterfaceListByPage,
		getSystemNums,
		getSystemInfo
	} from '@/api/service.js';
	import sysInterfaceList from './components/sysInterfaceList';
	import busInterfaceList from './components/busInterfaceList';
	import interactedSystemList from './components/interactedSystemList';
	import environmentInfo from './components/environmentInfo';

	export default {

		data() {
			return {
				sysSum: '',
				busSum: '',
				row: {

				},
				systemNums: {

				},

			};

		},

		created() {
			this.row = this.$route.query;
			this.$store.commit('SET_SUBTITLE', "--" + this.row.systemName);
			this.getSystemInfo();
			this.getNum();
		},


		methods: {
			
			
			getSystemInfo(){
				getSystemInfo({
					"systemNo": this.row.systemNo
				}).then(response => {
					this.row = response.data.extend;
				}).catch(error => {
					console.info("失败");
					console.info(error.message);
				});
			},

			sysInterTotal(total) {
				this.sysSum = total;
			},

			busInterTotal(total) {
				this.busSum = total;
			},

			getNum() {
				getSystemNums({
					"systemNo": this.row.systemNo
				}).then(response => {
					this.systemNums = response.data.extend;
				}).catch(error => {
					console.info("失败");
					console.info(error.message);
				});
			}

		},

		components: {
			sysInterfaceList,
			busInterfaceList,
			interactedSystemList,
			environmentInfo
		},

	}
</script>

<style>
	.detailsTitle {
		color: black;
		font-size: 20px;
		text-align: left;
		margin-top: 10px;
		margin-left: 20px;
		margin-bottom: 10PX;
		border-left: 3px solid #090;
		line-height: 24px;
		padding-left: 10px;
		color: #57595d;
	}

	.serviceInfo {
		text-align: left;
		margin-left: 40px;
	}

	.serviceInfo span {
		line-height: 30px;
		text-align: left;
		color: #606266;
		font-size: 14px;
	}

	.el-divider--horizontal {
		margin: 12px 0;
		;
	}
</style>
